
{% assign member = page %}

<div class="bigspacer"></div>

<div class="row">
    <div class="col-md-3">
        <div class="media">
            {% if member.image %}
            <img class="pull-left pad-right big-member-photo" src="{{ member.image }}">
            {% endif %}
        </div>
    </div>
    <div class="col-md-9">
        <div class="pull-left pad-right media-body titlebox">
            <div class="title media-heading">
                {{ member.title }}
            </div>
            <br/>
            <div class="smallhead">
                {{ member.position }}
            </div>
        </div>
    </div>
</div>

<div class="bigspacer"></div>

<div class="row">
    <div class="col-md-3">
        {% if member.homepage %}
        <div class="smallhead">
            Homepage
        </div>
        <div class="pad-left note">
            <div class="smallspacer"></div>
            <i class="fas fa-home fa-fw"></i>
            <a class="off" href="{{ member.homepage }}">{{ member.homepage }}</a>
        </div>
        <div class="bigspacer"></div>
        {% endif %}
        {% if member.cv %}
        <div class="smallhead">
            CV
        </div>
        <div class="pad-left note">
            <div class="smallspacer"></div>
            <i class="far fa-file-alt fa-fw"></i>
            <a class="off" href="{{ member.cv }}">{{ member.cv | split: '/' | last }}</a>
        </div>
        <div class="bigspacer"></div>
        {% endif %}
        {% if member.twitter %}
        <div class="smallhead">
            Twitter
        </div>
        <div class="pad-left note">
            <div class="smallspacer"></div>
            <i class="fab fa-twitter fa-fw"></i>
            <a class="off" href="https://twitter.com/{{ member.twitter }}">{{ member.twitter }}</a>
        </div>
        <div class="bigspacer"></div>
        {% endif %}
        {% if member.github %}
        <div class="smallhead">
            GitHub
        </div>
        <div class="pad-left note">
            <div class="smallspacer"></div>
            <i class="fab fa-github-alt fa-fw"></i>
            <a class="off" href="https://github.com/{{ member.github }}">{{ member.github }}</a>
        </div>
        <div class="bigspacer"></div>
        {% endif %}
        {% if member.orcid %}
        <div class="smallhead">
            ORCID
        </div>
        <div class="pad-left note">
            <div class="smallspacer"></div>
            <i class="ai ai-orcid fa-fw"></i>
            <a class="off" href="https://orcid.org/{{ member.orcid }}">{{ member.orcid }}</a>
        </div>
        <div class="bigspacer"></div>
        {% endif %}
        {% if member.scholar %}
        <div class="smallhead">
            Google Scholar
        </div>
        <div class="pad-left note">
            <div class="smallspacer"></div>
            <i class="ai ai-google-scholar fa-fw"></i>
            <a class="off" href="https://scholar.google.com/citations?user={{ member.scholar }}">{{ member.title }}</a>
        </div>
        <div class="bigspacer"></div>
        {% endif %}
        {% if member.email %}
        {% assign emailarray = member.email | split: '@' %}
        <div class="smallhead">
            Email
        </div>
        <div class="pad-left note">
            <div class="smallspacer"></div>
            <i class="fas fa-inbox fa-fw"></i>
            {{ emailarray.first }}<span style="display:none">obfuscate</span>@{{ emailarray.last }}
        </div>
        <div class="bigspacer"></div>
        {% endif %}
    </div>
    <div class="col-md-8">
        <div class="post">
            {{ content }}
        </div>

        <div class="bigspacer"></div>

        {% assign lastname = member.title | split: ' ' | last %}
        {% assign firstinitial = member.title | split: ' ' | first | slice: 0 %}
        {% assign searchstring = lastname | append: ' ' | append: firstinitial %}

        {% for paper in site.categories.papers %}
            {% if paper.authors contains searchstring %}
                {% assign papersq = true %}
            {% endif %}
        {% endfor %}

        {% if papersq == true %}
            <div class="bigspacer"></div>
            <div class="head">Papers</div>
            <div class="spacer"></div>
            {% for paper in site.categories.papers %}
                {% if paper.authors contains searchstring %}
                    {% if paper.embargo %}
                    <p><i class="far fa-file-alt fa-fw" aria-hidden="true"></i> {{ paper.title }}
                    {% else %}
                    <p><a href="{{ paper.url }}" class="off"><i class="far fa-file-alt fa-fw" aria-hidden="true"></i> {{ paper.title }}</a>
                    {% endif %}
                {% endif %}
            {% endfor %}
        {% endif %}


        {% for paper in site.data.conference-papers %}
            {% if paper.authors contains searchstring %}
                {% assign papersq = true %}
            {% endif %}
        {% endfor %}

        {% if papersq == true %}
            <div class="bigspacer"></div>
            <div class="head">Conference Papers</div>
            <div class="spacer"></div>
            {% for paper in site.data.conference-papers %}
                {% if paper.authors contains searchstring %}
                    {% if paper.pdf %}
                    <p><a href="{{ paper.pdf }}" class="off"><i class="far fa-file-alt fa-fw" aria-hidden="true"></i> {{ paper.authors }}. "{{ paper.title }}." {{ paper.meeting }}. {{ paper.month }} {{ paper.year }}</a>
                    {% else %}
                    <p><i class="far fa-file-alt fa-fw" aria-hidden="true"></i> {{ paper.authors }}. "{{ paper.title }}." {{ paper.meeting }}. {{ paper.month }} {{ paper.year }}
                    {% endif %}
                {% endif %}
            {% endfor %}
        {% endif %}

        {% for post in site.categories.blog %}
            {% if member.handle == post.author_handle %}
                {% assign postsq = true %}
            {% endif %}
        {% endfor %}

        {% if postsq == true %}
            <div class="bigspacer"></div>
            <div class="head">Posts</div>
            <div class="spacer"></div>
            {% for post in site.categories.blog %}
                {% if member.handle == post.author_handle %}
                    <p><a href="{{ post.url }}" class="off"><i class="fas fa-rss" aria-hidden="true"></i> {{ post.title }}</a>
                {% endif %}
            {% endfor %}
        {% endif %}

    </div>
    <div class="col-md-1"></div>
</div>
